import { createApp, defineAsyncComponent } from 'vue';
import pinia from '/@/stores/index';
import App from '/@/App.vue';
import router from '/@/router';
import { directive } from '/@/directive/index';
import other from '/@/utils/other';
import ElementPlus from 'element-plus';
import '/@/theme/index.scss';
import VueGridLayout from 'vue-grid-layout';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import screenShort from 'vue-web-screen-shot';
import 'virtual:svg-icons-register';
/**
 * 导出全局注册 element plus svg 图标
 * @param app vue 实例
 * @description 使用：https://element-plus.gitee.io/zh-CN/component/icon.html
 */

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component);
}

directive(app);
other.elSvg(app);

app.use(pinia).use(router).use(ElementPlus).use(VueGridLayout).use(screenShort, { enableWebRtc: false }).mount('#app');
